Topic RequirementsWrite a C-language program simulation to implement the STRCMP function.(We still simulate the implementation of the STRCMP function, and then against the String.h library in the implementation of the STRCMP function, compared with
Conversion from: Implementation and explanation of strcmp Functions
The strcmp function is a basic function in C/C ++. It compares two strings and returns the comparison result. The function form is as follows:Int strcmp (constchar * str1,
strcmp and strncmp are used to compare strings, and the difference is whether the specified length string can be compared. strcmp
C + + functions, comparing two stringsSet these two strings as STR1,STR2,If STR1==STR2, return 0;If str1 > str2, return
strcmp (): string comparison function,Function: c/s + + function, compare two strings, involving two strings corresponding to the character by comparison, until the discovery does not match, the first mismatch is small, large, if one string is the
The realization of strcmpIntroduction to the function prototype: extern int strcmp (const char *s1,const char * s2);
Usage:Add header file #include
function:Compares strings S1 and S2.
general form:strcmp (String 1, String 2)
return Value:
String as a more important part of C language, learning this part requires us to understand more. Analysis. We are in the process of learning the first in the mind a clear idea, according to this idea on the computer to knock out. Just start
Note Convert to unsigned char:Strcmp.h1 #ifndef Strcmp_h2 #defineStrcmp_h3 4 /***************************************************5 function: Compare strings S1 and S2. 6 general form: strcmp (S1,S2)7 return Value:8 when S19 when S1=s2, the return
Pointers Small Knowledge Points:int a = 10;int *p=&a;int *q=p; The address of A is saved in Pint *q=p; Assigning the value of p to the Q function is to let Q also point to aStrlen (); To find the length of a stringstrcpy (); Copy stringStrcat ();
Common Linux C functions-memory and string operations-general Linux technology-Linux programming and kernel information. For more information, see the following. Bcmp (memory content comparison)
Related functions: bcmp, strcasecmp, strcmp, strcoll,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.